/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sbbs.flux.example;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 *
 * @author MACHENIKE
 */
@RestController
public class HelloWorld {

    @GetMapping("/helloMvc")
    public String hello() {
        return "Welcome to reactive world mvc ~";
    }

    @GetMapping("/helloFlux")
    public Mono<String> helloMono() {   // 【改】返回类型为Mono<String>
        return Mono.just("Welcome to reactive world flux ~");     // 【改】使用Mono.just生成响应式数据
    }

}
